package com.teapos.enumtype;

public enum TradeTypeEnum {
	
	SCAT(1, "散客买茶"),
	VIP(2, "会员买茶"),
	BEFORE(3, "预收款管理"),
	BUY(4, "货品收购"),
	PAD(5, "pad下单");
	
	private int code;
	private String desc;
	private TradeTypeEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public static TradeTypeEnum getEnumByCode(int code) {
		TradeTypeEnum[] enums = TradeTypeEnum.values();
		for(TradeTypeEnum enumtype:enums) {
			if(enumtype.getCode()==code) return enumtype;
		}
		return null;
	}

}
